<script setup lang="ts">
const scrollEle = inject<Ref<HTMLDivElement>>(SCROLL_ELE);
const { y } = useScroll(scrollEle);
const isShow = computed(() => y.value > 300);
</script>

<template>
  <FixedButton v-show="isShow" @click="y = 0" class="back-top-btn">
    <SvgIcon name="icon-up"></SvgIcon>
  </FixedButton>
</template>

<style lang="scss" scoped>
.back-top-btn {
  width: 30rem;
  height: 30rem;
  bottom: 80rem;
  right: 20rem;
}
</style>
